package com.westos.calcv3;

import com.westos.calcv2.AddOperator;
import com.westos.calcv2.IOperator;
import org.springframework.beans.factory.FactoryBean;

public class OperatorFactoryBean implements FactoryBean<IOperator> {
    //类似于简单工厂模式
    public IOperator getObject() throws Exception {
        System.out.println("使用FactoryBean创建对象");
        return new AddOperator();
    }

    public Class<?> getObjectType() {
        return IOperator.class;
    }

    public boolean isSingleton() {
        return true;
    }
}